import 'package:flutter/material.dart';
import 'package:flutter_module/tabbar/shop/shopTagModel.dart';
import 'package:flutter_module/tool/userManager.dart';

 class ShopScreenTagProvider with ChangeNotifier {

  List<ShopTagModel> _headerList = [];
  List<ShopTagModel> get headerList => _headerList;
  

  List<ShopTagModel> defalutShopScreenTagHeaderList(){
    _headerList = [];
    ShopTagModel model = ShopTagModel();
    model.name = UserManager.instance.userInfo.enterprise.abbrName;
    _headerList.add(model);
    return _headerList;
  }

  void setShopScreenTagHeaderList(List<ShopTagModel> headerList) {
    if (headerList.length == 1) {
      ShopTagModel model = ShopTagModel();
      model.name = UserManager.instance.userInfo.nickname;
      headerList.insert(0, model);
    }
    _headerList = headerList;
    notifyListeners();
  }

  void reloadShopScreenTagHeaderList(List<ShopTagModel> headerList){
    _headerList = headerList;
    notifyListeners();
  }

}